package beans;

import javax.ejb.Stateless;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import entidades.Cliente;

/**
 * Session Bean implementation class Cliente
 */
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class ClienteBean implements ClienteRemote {

   @PersistenceContext(name="SuperClienteEJB")
   EntityManager em;
	/**
     * Default constructor. 
     */
    public ClienteBean() {
        // TODO Auto-generated constructor stub
    }
    
    
    public void crear(entidades.Cliente c){
    	
    	//em.getTransaction().begin();
    	em.persist(c);
    	//em.getTransaction().commit();
    	
    	
    }
    
    public void nuevo(){
    	
    }


	@Override
	public Cliente buscar(String cedula) {
		// TODO Auto-generated method stub
		return em.find(Cliente.class, cedula);
	}



}
